{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Question 70\n",
    "\n",
    "### **Question**\n",
    "\n",
    "> **_Please write a program to output a random even number between 0 and 10 inclusive using random module and list comprehension._**\n",
    "\n",
    "---\n",
    "\n",
    "### Hints\n",
    "\n",
    "> **_Use random.choice() to a random element from a list._**\n",
    "\n",
    "---\n",
    "\n",
    "\n",
    "\n",
    "**Solutions:**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "resp = [i for i in range(0, 11, 2)]\n",
    "print(random.choice(resp))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "# Question 71\n",
    "\n",
    "### **Question**\n",
    "\n",
    "> **_Please write a program to output a random number, which is divisible by 5 and 7, between 10 and 150 inclusive using random module and list comprehension._**\n",
    "\n",
    "---\n",
    "\n",
    "### Hints\n",
    "\n",
    "> **_Use random.choice() to a random element from a list._**\n",
    "\n",
    "---\n",
    "\n",
    "\n",
    "\n",
    "**Solutions:**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "resp = [i for i in range(10, 151) if i % 35 == 0]\n",
    "print(random.choice(resp))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "# Question 72\n",
    "\n",
    "### **Question**\n",
    "\n",
    "> **_Please write a program to generate a list with 5 random numbers between 100 and 200 inclusive._**\n",
    "\n",
    "---\n",
    "\n",
    "### Hints\n",
    "\n",
    "> **_Use random.sample() to generate a list of random values._**\n",
    "\n",
    "---\n",
    "\n",
    "\n",
    "\n",
    "**Solutions:**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "resp = random.sample(range(100, 201), 5)\n",
    "print(resp)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "# Question 73\n",
    "\n",
    "### **Question**\n",
    "\n",
    "> **_Please write a program to randomly generate a list with 5 even numbers between 100 and 200 inclusive._**\n",
    "\n",
    "---\n",
    "\n",
    "### Hints\n",
    "\n",
    "> **_Use random.sample() to generate a list of random values._**\n",
    "\n",
    "---\n",
    "\n",
    "\n",
    "\n",
    "**Solutions:**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "resp = random.sample(range(100, 201, 2), 5)\n",
    "print(resp)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---\n",
    "\n",
    "# Question 74\n",
    "\n",
    "### **Question**\n",
    "\n",
    "> **_Please write a program to randomly generate a list with 5 numbers, which are divisible by 5 and 7 , between 1 and 1000 inclusive._**\n",
    "\n",
    "---\n",
    "\n",
    "### Hints\n",
    "\n",
    "> **_Use random.sample() to generate a list of random values._**\n",
    "\n",
    "---\n",
    "\n",
    "\n",
    "\n",
    "**Solutions:**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random\n",
    "\n",
    "lst = [i for i in range(1, 1001) if i % 35 == 0]\n",
    "resp = random.sample(lst, 5)\n",
    "print(resp)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "---"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
